package zaphod.jsp1;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;

public class Writer
{
    private static final String INSERT_SQL = null;

    @SuppressWarnings( "unchecked" )
    public static boolean isValid( HttpServletRequest request )
    {
        Map< String, String[] > params = request.getParameterMap();
        Set< String > paramKeys = params.keySet();

        System.out.println( "task!!" );

        for ( Object key : paramKeys )
        {
            System.out.println( key + ":" + params.get( key )[0] );

        }
        return true;
    }

    public static void write( HttpServletRequest request )
    {
        Connection connection = BoardManager.getConnection();
        try
        {
            PreparedStatement statement = connection
                .prepareStatement( INSERT_SQL );
        }
        catch ( SQLException e )
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

}
